The instant invention relates to the electronic printing of documents from a computer, and more particularly to a system and method for correctly ordering and printing graphics within a merged text and graphics document for printing from a computer by a raster printer.
Continued advances in computer technology have lead to not only increased performance, but also increased performance expectations by the users of such equipment. These increased user expectations extend not only to processing speed capability, but also to all aspects and peripheral equipment associated with a home or business computing environment. The industry has responded with increased speed for CD ROM drives, communication modems, and even faster printers having advanced document handling features. However, it is not simply enough to utilize a faster processor in conjunction with peripheral equipment having performance enhancing features without also including software drivers and an operating system which allows the full advantage of the increased hardware capabilities to be taken advantage of.
This is particularly true in the area of document printing. Initially, the vast majority of all documents sent to a computer printer were text only documents with very little, if any, formatting. The printers on which these documents were printed included daisy wheel or ball type printers which required only that the computer send down the proper character commands to allow printing of the proper text character. As the computing equipment advanced, so did the sophistication of the computer user. Strict text only unformatted documents utilizing only a single font were no longer acceptable. The computer industry responded by allowing the computer to command a printer to draw various True Type fonts which greatly enhanced the appearance of the computer printed document. However, it was a concern that the performance of the printers would be affected by having to draw all of the characters on a printed document. In response, printer manufacturers began installing device resident fonts within the memory of the printers to allow a very rapid data transfer to occur from the computer to the printer. With installed device fonts the computer is required only to send a character address code to the printer to allow the printer to select and print the correct character. This greatly reduced the amount of data transferred between computer and printer, and greatly enhanced the printing performance.
During this development of better ways to format and print text documents, the use and integration of graphics within a computer generated text document was also introduced. School and company, newsletters, technical reports, financial presentations, etc. all were utilizing text and graphics in an integrated computer printed document. Initially, the inserted graphics occupied a given space on a page, but continuing advances soon allowed the text of the document to be wrapped around the graphics, or layered over the graphics in the case of a computer generated watermark. Because the inclusion of graphics greatly enhanced the appearance of what would otherwise be considered a dull page of only text, the use of graphics greatly increased. However, it was soon realized that the use of both graphics and text in the same document presented significant problems for the computer hardware, software, and operating systems of the day.
To allow a computer generated document to be printed by a computer printer requires the use of a printer driver. Such a printer driver interfaces the output from the application program which generated the document to the physical printer device which will actually put ink on paper. The more recent printer drivers were frame buffer based with text support. As such, a page of a document to be printed was essentially split into a bitmap graphics frame 200 and a text frame 202 as illustrated in FIG. 5. The bitmap graphics frame 200 contained all of the bitmap graphical images which were to be printed on the document, while the text frame contained all of the textual information for that same document. Within this prior printer driver, both the graphics frame 200 and the text frame 202 existed at different levels within the driver as illustrated graphically in FIG. 5. Because all of the graphics in a document existed in the bitmap frame 200, the specific order and layering of these drawing objects were not always maintained when combined with the separate text frame 202 and printed at the printer device. This could result in the graphic color highlighting of the text actually covering, and therefore obscuring, the text to be highlighted. Because of the visualization of the separate frames for both text and bitmap graphics, this problem became known as the Z-order problem. This nomenclature was chosen to convey the lack of proper layering of the different frames 200, 202 as the document was printed. This Z-order problem resulted in not only a poor quality printed document which did not appear on the printed page as it did on the computer monitor.
One prior solution which overcomes the Z-ordering problem of the text and graphics draws the entire page as,a single bitmap graphic. The document to be printed is essentially transformed into a picture of the document to be printed by the computer printer. However, while this alleviates the problem of properly combining and layering the separate text and bitmap graphics frames of the prior printer driver, the resulting degradation in printer performance due to the extreme amount of data to be transferred to the printer is unacceptable. Printer speed and performance is greatly affected, and the included device fonts resident within the printer are not be utilized, therefore wasting the advanced features of modem computer printers. Such a solution, therefore, is not acceptable.
Another solution to the Z-order problem which some drivers utilize is to send objects to the printer as they are encountered from the GDI (although, this capability is not available on all printer devices). This method takes advantage of the raster operations (ROPs) which are available in the windows environment. These ROPs allow print elements to be combined in logical ways (e.g., XOR) to ensure that they are printed in the correct order. For a highlighted block of text, the GDI may send the text elements first, and then the colored box. ROP allows these elements to be combined so that the text is not printed first, and then covered (obscured) by the colored box. Unfortunately, many of the printers on the market do not support the downloading of all graphics objects or all of the ROPs available within the windows environment. As a result, a document with merged text and graphics may still not print correctly due to the lack of support for at least some of the ROP functions needed by these drivers.
There therefore exists a need in the art for a system and method which allows the correct printing of documents having merged text and graphics, i.e., incorporating a solution for the Z-order problem. However, there also exists a need for documents to be printed with enhanced performance and greater speed allowing advanced printer functions to be taken advantage of to the greatest extent possible.
In view of the above identified and other problems existing in the art, a preferred embodiment of the instant invention provides a printer driver which overcomes the Z-order problem of correctly printing merged text and graphics documents. A preferred embodiment further enhances the printing performance by utilizing, to the maximum extent possible, the device fonts resident within the physical printer device. Preferably, an embodiment of the printer driver of the instant invention analyzes the document which it is printing to determine the overlap of any text and graphics contained therein. If an overlap of text and graphics is detected, a preferred embodiment of the printer driver of the instant invention selectively draws only the overlapping text as graphics on a frame buffer. If there is no merging or overlapping of text and graphics:on the document which is being printed, the text is simply downloaded or sent as a device font directly to the printer device. Preferably, the printer driver of the instant invention utilizes font substitution and selective drawing of text as graphics to ensure proper printing of either text only, or text and graphics merged documents without loss or degradation of printer performance.
In a preferred embodiment of the printer driver of the instant invention, the driver determines for each text object whether there is any previously drawn graphics in the bitmap where the text is to be drawn. If such a bitmap is found, the text is also drawn in the bitmap so that it can properly interact with the graphics on the printed page. If no such overlapping graphics and text is detected, the text is downloaded or sent as a device font directly to the printer to allow for better printing performance. Preferably, the printer driver of the instant invention also maintains text location information concerning the location of where text has been downloaded directly to the printer. This textual location information is utilized in the event that a graphics image is to be drawn over text which has already been downloaded to the printer. If this situation is detected, a preferred embodiment of the driver of the instant invention sends a blank bitmap image, preferably a white rectangle, directly to the printer to erase or overwrite the appropriate region in the printer to ensure correct output when the text and bitmaps are combined during the print process. Preferably, an embodiment of the printer driver of the instant invention accomplishes the above in a single pass fashion as the print commands are received from the graphics device interface (GDI). The elimination of any subsequent passes through the print command or data information, also greatly enhances the overall performance of the printing function.
These and other features of the invention will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.